<template>
  <div class="main-content">
    <div class="search-container">
      <report-search v-model="params"
                     class="search-container-left" />
      <div class="search-container-right">
        <button type="button"
                class="btn btn-theme"
                v-on:click="list(1)"
                style="background-color: #f87242; color: #fff">查询</button>
        <button type="button"
                class="btn btn-theme"
                v-on:click="exportInfo"
                v-if="userAuthResources.indexOf(resourcesList.menu_0005_0001_0003) >= 0">导出</button>
        <a :href="exportUrl"
           v-show="exportBtnShow"
           download="报备记录.xlsx"
           style="color: yellowgreen; padding-left: 20px;">
          点击下载
          <Icon type="md-cloud-download"
                size="16" />
        </a>
      </div>
    </div>
    <div class="table-responsive report-table">
      <Table stripe
             border
             :columns="tableConfig"
             :data="customerPremisesList"
             @on-selection-change="selectChanege"></Table>
    </div>
    <div id="laypage_cur_pre"></div>

    <addFollowModal ref="addFollow"
                    v-bind:followUpModal="followUpInfo"
                    v-on:savefollowUpListener='saveAuditReturn'></addFollowModal>
    <batchToM2Modal v-bind:ToM2InfoModal="ToM2Info"
                    v-on:batchToM2Listener='batchToM2Listener'></batchToM2Modal>
    <mobileCompleted v-bind:mobileCompleteModal="mobileCompleteInfo"
                     v-on:saveMobileListener='mobileCompleteReturn'></mobileCompleted>
    <audit ref="audit"
           v-bind:auditModal="auditInfo"
           v-on:saveAuditListener='saveAuditReturn'></audit>
    <confirm v-bind:confirmModal="confirmInfo"
             v-on:saveConfirmListener='saveAuditReturn'></confirm>
    <mortgage v-bind:mortgageModal="mortgageInfo"
              v-on:saveMortgageListener='saveAuditReturn'></mortgage>
    <m2 v-bind:m2Modal="m2Info"
        v-on:saveM2Listener='saveAuditReturn'></m2>
    <batchErrorInfoModel v-bind:errorInfo="errorInfo"></batchErrorInfoModel>
    <signFail v-bind:signFailCusPre="signFailCusPre"
              v-on:saveSignFail='saveAuditReturn'></signFail>
    <insertModal :firstPaymentInfo="firstPaymentInfo"
                 v-on:saveInfo='saveAuditReturn'></insertModal>
    <!-- <copyReport v-bind:copyReportModal="copyContent"></copyReport> -->
    <!-- <CusPreDetailModal v-bind:cusPreId="cusPreId" v-on:closeModalListener='saveAuditReturn'></CusPreDetailModal> -->
    <editCusModal v-bind:customerInfo="customerInfo"
                  v-on:editCusListener='saveAuditReturn'></editCusModal>

  </div>
</template>
const name = _self.params.name;
const customerStatus = _self.params.customerStatus;
const createTimeBefore = _self.params.createTimeBefore;
const createTimeAfter = _self.params.createTimeAfter;
const confirmStatus = _self.params.confirmStatus;
const companyId = _self.params.companyId;
const agentId = _self.params.agentId;
<script>
const timeTypeArray = [
  { type: "1", val: "报备时间" },
  { type: "2", val: "到访时间" },
  { type: "3", val: "认筹时间" },
  { type: "4", val: "认购时间" },
  { type: "5", val: "签约时间" },
  { type: "6", val: "交易失败时间" }
];
const reportUserTypeList = [
  { type: "1", val: "案场代报备" },
  { type: "2", val: "经纪人报备" }
];
import moment from "moment";
import addFollowModal from "./cusPreFollowUp.vue";
import batchToM2Modal from "./cusBatchToM2.vue";
import mobileCompleted from "./cusMobileCompleted.vue";
import audit from "./cusAudit.vue";
import confirm from "./cusChangeConfirm.vue";
import mortgage from "./cusChangeMortgage.vue";
import m2 from "./cusToM2.vue";
import batchErrorInfoModel from "./cusBatchToM2ErrorInfo.vue";
import dataTable from "../../constants/tableConfig.js";
import signFail from "./signFail.vue";
import insertModal from "./insertModal.vue";
import { formatDate } from "../../assets/js/date.js";
// import copyReport from "./copyReport.vue";
// import CusPreDetailModal from './cusPreDetailModal.vue'
import editCusModal from "./editCusModal.vue";
// import remindExamine from './remindExamine.vue'
import ReportSearch from "./components/ReportSearch.vue";
// import VueClipboard from 'vue-clipboard2'
export default {
  data() {
    return {
      params: {
        pageSize: 10,
        pageNo: 1,
        userId: window.localStorage.getItem("1_userId"),
        companyId: "",
        name: "",
        customerStatus: "",
        createTimeBefore: "",
        createTimeAfter: "",
        confirmStatus: "",
        agentId: "",
        timeType: "",
        reportUserType: "",
        agencyDeptId: "",
        storeOrGroupId: "",
        groupId: "",
        premisesId: "",
        recommenderId: "",
        visitState: ""
      },
      errorInfo: [],
      customerPremisesList: [],
      customerArray: [],
      confirmArray: [],
      timeTypeArray: timeTypeArray,
      reportUserTypeList: reportUserTypeList,
      appealInfo: {
        cusPremisesId: ""
      },
      agentOrgArray: [],
      partnerArray: [],
      followUpInfo: {
        customerPremisesId: "",
        followPerson: "",
        checkSwitch: "",
        lastCheckTime: ""
      },
      ToM2Info: {
        num: 0,
        ids: ""
      },
      mobileCompleteInfo: {
        id: "",
        mobile: "",
        date: ""
      },
      auditInfo: {
        id: "",
        title: "",
        customerStatus: "",
        premisesId: ""
      },
      confirmInfo: {
        id: "",
        confirmStatus: ""
      },
      firstPaymentInfo: {
        payFinish: "",
        id: "",
        firstPayment: "",
        firstPaymentRatio: ""
      },
      mortgageInfo: {
        id: ""
      },
      m2Info: {
        id: "",
        name: "",
        mobile: "",
        premisesName: ""
      },
      customerInfo: {
        cpId: "",
        name: "",
        gender: "",
        remark: ""
      },
      resourcesList: {
        menu_0005_0001_0001: "menu_0005_0001_0001", //批量转客
        menu_0005_0001_0002: "menu_0005_0001_0002", //号码补全
        menu_0005_0001_0003: "menu_0005_0001_0003", //导出
        menu_0005_0001_0004: "menu_0005_0001_0004", //写跟进
        menu_0005_0001_0005: "menu_0005_0001_0005", //报备审核
        menu_0005_0001_0006: "menu_0005_0001_0006", //到访审核
        menu_0005_0001_0007: "menu_0005_0001_0007", //交易状态变更
        menu_0005_0001_0008: "menu_0005_0001_0008", //按揭状态变更
        menu_0005_0001_0009: "menu_0005_0001_0009" //转客
      },
      userAuthResources: window.localStorage.getItem("userAuthResources"),
      tableConfig: [],
      selectRow: [],
      signFailCusPre: {},
      copyContent: "",
      cusPreId: "",
      timeTypeLabel: "报备时间",
      exportBtnShow: false,
      exportUrl: "",
      timeOut: 10
    };
  },
  components: {
    addFollowModal,
    batchToM2Modal,
    mobileCompleted,
    audit,
    confirm,
    mortgage,
    m2,
    batchErrorInfoModel,
    dataTable,
    signFail,
    insertModal,
    // copyReport,
    // CusPreDetailModal,
    editCusModal,
    // remindExamine
    ReportSearch
  },
  mounted: function () {
    this.list(0);
    //this.customerStatuList();
    //this.confirmStatuList();
    //this.agentOrgList();
    dataTable.config.table = this;
    this.tableConfig = dataTable.config.cusPreColumns;
  },
  watch: {
    "params.companyId": "selectAgentOrg"
  },
  methods: {
    chooseTimeType() {
      if (!this.params.timeType) {
        this.params.createTimeBefore = "";
        this.params.createTimeAfter = "";
        this.timeTypeLabel = "报备时间";
      } else {
        this.timeTypeArray.forEach((item) => {
          if (item.type == this.params.timeType) {
            this.timeTypeLabel = item.val;
          }
        });
      }
    },
    selectChanege: function (res) {
      let _self = this;
      _self.ToM2Info.ids = "";
      if (res && res.length > 0) {
        var ids = [];
        for (let i = 0; i < res.length; i++) {
          ids.push(res[i].id);
        }
        _self.ToM2Info.ids = ids.toString() + ",";
      }
    },
    mobileCompleteReturn: function (res) {
      this.list(0);
    },
    batchToM2Listener: function (res) {
      let _self = this;
      let msg =
        "&nbsp;&nbsp;&nbsp;总转客数：" +
        res.total +
        "<br/>" +
        "转客成功数：" +
        res.successNum +
        "<br/>" +
        "转客失败数：" +
        res.failNum;
      //当有失败数时，展示失败记录
      if (res.failNum > 0) {
        msg += "<br/>是否查看错误信息？";
        layer.confirm(
          msg,
          {
            btn: ["是", "否"] //按钮
          },
          function () {
            _self.errorInfo = res.failList;
            layer.closeAll("dialog");
            $("#batchToM2Modal").modal("hide");
            $("#batchErrorInfoModel").modal("show");
            //	   showFailList(rs);
          },
          function () {
            layer.closeAll("dialog");
          }
        );
      } else {
        layer.alert(msg);
        _self.list(0);
      }
    },
    list: function (type) {
      var loadIndex = layer.load();
      //加载数据
      var _self = this;
      //判断点查询按钮时，将当前页和条数设置为默认
      if (type == 1 && _self.params) {
        _self.params.pageNo = "1";
        _self.params.pageSize = "10";
        window.localStorage.setItem("curPrePage", 1);
        // return  // 临时······ 新加字段后端报错
      }
      var url = this.utilHelper.apiUrl + "/api/getAssistantReportPage";
      var body = {};
      body.params = (_self.params &&
        JSON.parse(JSON.stringify(_self.params))) || {
        pageSize: 10,
        pageNo: 1
      };
      if (body.params.type) {
        var dateArr = body.params.type;
        body.params.createTimeBefore = moment(dateArr[0]).format("YYYY-MM-DD");
        body.params.createTimeAfter = moment(dateArr[1]).format("YYYY-MM-DD");
      }
      delete body.params.type;
      _self.$http.post(url, body).then(
        (response) => {
          layer.close(loadIndex);
          var body = response.body;
          if (body.result == 1) {
            var total = body.resData.cpDtoPage.total;
            _self.customerPremisesList = body.resData.cpDtoPage.rows;
            for (var ii = 0; ii < _self.customerPremisesList.length; ii++) {
              var record = _self.customerPremisesList[ii];
              var commissionAmount = record.commissionAmount;
              var customerStatus = record.customerStatus;
              var commissionStatus = record.commissionStatus;
              var CommissionIsShow = record.commissionIsShow;
              //非缴定、已结佣状态的记录,佣金金额统一设置为待定
              if (
                (commissionAmount &&
                  (customerStatus == 5 || customerStatus == 7)) ||
                CommissionIsShow == "1"
              ) {
                record.commissionAmount = _self.changeToDecimal(
                  record.commissionAmount,
                  2
                );
                record.reward = _self.changeToDecimal(record.reward, 2);
              } else {
                record.commissionAmount = "待定";
              }
              if (
                commissionAmount &&
                (customerStatus == 5 ||
                  customerStatus == 6 ||
                  customerStatus == 7)
              ) {
                record.reward = _self.changeToDecimal(record.reward, 2);
              } else {
                record.reward = "0";
              }
              // 静止多选l
              if (
                record.customerStatus != "-1" &&
                record.customerStatus != "0" &&
                record.customerStatus != "10" &&
                record.isToM2 != "1" &&
                record.projectCodeM2 == "1"
              ) {
                record._disabled = false;
              } else {
                record._disabled = true;
              }

              //非已结佣记录的发放状态统一设置为待发放
              var payStatus = "待发放";
              if (commissionStatus == 1) {
                payStatus = "已发放";
              }
              if (CommissionIsShow == 1) {
                payStatus = "";
              }
              record.payStatus = payStatus;
            }
            var current = body.resData.cpDtoPage.pageNumber;
            var totalPages = body.resData.cpDtoPage.totalPages;
            // if (totalPages > 0) {
            layui.laypage.render({
              elem: $("#laypage_cur_pre"), //容器。值支持id名、原生dom对象，jquery对象,
              limit: _self.params && _self.params.pageSize,
              curr: current,
              count: total,
              theme: "#f87242;", //皮肤
              first: "首页", //若不显示，设置false即可
              last: "尾页", //若不显示，设置false即可
              prev: "上一页", //若不显示，设置false即可
              next: "下一页", //若不显示，设置false即可
              layout: ["prev", "page", "next", "skip", "count"],

              jump: function (obj, first) {
                if (!first) {
                  _self.params = _self.params || { pageSize: 10, pageNo: 1 };
                  _self.params.pageNo = obj.curr;
                  _self.list(0);
                }
              }
            });
            // }
            _self.cusPreId = "";
          } else {
            //layer.alert("系统异常!");
            _self.customerPremisesList = [];
            layui.laypage.render({
              elem: $("#laypage_cur_pre"), //容器。值支持id名、原生dom对象，jquery对象,
              limit: _self.params.pageSize,
              curr: 1,
              count: 0,
              theme: "#f87242;", //皮肤
              first: "首页", //若不显示，设置false即可
              last: "尾页", //若不显示，设置false即可
              prev: "上一页", //若不显示，设置false即可
              next: "下一页", //若不显示，设置false即可
              layout: ["prev", "page", "next", "skip", "count"],

              jump: function (obj, first) {
                if (!first) {
                  _self.params.pageNo = obj.curr;
                  _self.list(0);
                }
              }
            });
          }
        },
        (response) => {
          layer.close(loadIndex);
        }
      );
    },
    customerStatuList: function () {
      var _self = this;
      var url = this.utilHelper.apiUrl + "/common/getEnum/CustomerStatusEnum";
      _self.$http.get(url, {}).then(
        (response) => {
          _self.customerArray = response.body.data;
        },
        (response) => {
          //layer.alert("系统异常!");
        }
      );
      /*	*/
    },
    toEditCus(id, name, gender, remark) {
      this.customerInfo.cpId = id;
      this.customerInfo.name = name;
      this.customerInfo.gender = gender;
      this.customerInfo.remark = remark;
      $("#editCusModal").modal({
        backdrop: "static",
        keyboard: false
      });
    },
    toDetail: function (cusPreId) {
      // 跳转报备详情,新打开一个而窗口
      let router = this.$router.resolve({
        path: "/cusPreDetail/" + cusPreId
      });
      window.open(router.href, "_blank");
    },
    toFollow: function (
      cusPremisesId,
      name,
      customerStatus,
      confirmStatus,
      checkSwitch,
      lastCheckTime
    ) {
      //经纪人填写跟进
      if (
        !this.followUpInfo.customerPremisesId ||
        this.followUpInfo.customerPremisesId != cusPremisesId ||
        !this.followUpInfo.lastCheckTime
      ) {
        this.followUpInfo.lastCheckTime = lastCheckTime;
      }
      this.followUpInfo.customerPremisesId = cusPremisesId;
      this.followUpInfo.followPerson = name;
      this.followUpInfo.customerStatus = customerStatus;
      this.followUpInfo.confirmStatus = confirmStatus;
      this.followUpInfo.checkSwitch = checkSwitch;

      this.$refs.addFollow.init();
      $("#addFollowModal").modal({
        backdrop: "static",
        keyboard: false
      });
    },
    changeToDecimal(value, point) {
      var f_x = parseFloat(value);
      if (isNaN(f_x)) {
        value = "0";
      }
      var f_x = Math.round(value * 100) / 100;
      var s_x = f_x.toString();
      var pos_decimal = s_x.indexOf(".");
      if (pos_decimal < 0) {
        pos_decimal = s_x.length;
        s_x += ".";
      }
      while (s_x.length <= pos_decimal + point) {
        s_x += "0";
      }
      return s_x;
    },
    saveAppealReturn() {
      this.list();
    },
    confirmStatuList: function () {
      var _self = this;
      var url = this.utilHelper.apiUrl + "/common/getEnum/ConfirmStatusEnum";
      _self.$http.get(url, {}).then(
        (response) => {
          _self.confirmArray = response.body.data;
        },
        (response) => {
          //layer.alert("系统异常!");
        }
      );

      /*	*/
    },
    agentOrgList: function () {
      const _self = this;
      const url = this.utilHelper.apiUrl + "/api/getAgentOrgByDevOrg";
      const body = {
        params: {
          devCompanyId: ""
        }
      };
      _self.$http.post(url, body).then(
        (response) => {
          const res = response.body.resData;
          if (res.result == "0") {
            layer.alert(res.errorMsg);
          } else {
            _self.agentOrgArray = res.agentOrgList;
          }
        },
        (response) => {
          //layer.alert("系统异常!");
        }
      );
    },
    partnerList: function (companyId) {
      const _self = this;
      if (companyId == "") {
        _self.partnerArray = [];
        _self.params.agentId = "";
        return false;
      }
      const url = this.utilHelper.apiUrl + "/api/getPartnerByCompany";
      const body = {
        params: {
          companyId: companyId
        }
      };
      _self.$http.post(url, body).then(
        (response) => {
          const res = response.body.resData;
          if (res.result == "0") {
            layer.alert(res.errorMsg);
          } else {
            _self.partnerArray = res.partnerInfoList;
          }
        },
        (response) => {
          //layer.alert("系统异常!");
        }
      );
    },
    selectAgentOrg: function (val) {
      this.partnerList(val);
    },
    saveAuditReturn() {
      this.list();
    },
    exportInfo: function () {
      var loadIndex = layer.load();
      var _self = this;
      var body = {};
      body.params = (_self.params &&
        JSON.parse(JSON.stringify(_self.params))) || {
        pageSize: 10,
        pageNo: 1
      };
      body.params.loginType = "1";
      if (body.params.type) {
        var dateArr = body.params.type;
        body.params.createTimeBefore = moment(dateArr[0]).format("YYYY-MM-DD");
        body.params.createTimeAfter = moment(dateArr[1]).format("YYYY-MM-DD");
      }
      delete body.params.type;
      var url =
        this.utilHelper.apiUrl + "/api/channelreport/exportAssistantReport";
      _self.$http
        .get(url, { params: body.params, responseType: "blob" })
        .then((response) => {
          layer.close(loadIndex);
          _self.exportBtnShow = true;
          const blob = new Blob([response.body], {
            type: "application/vnd.ms-excel" // 将会被放入到blob中的数组内容的MIME类型
          });
          const objectUrl = URL.createObjectURL(blob);
          _self.exportUrl = objectUrl;
          layer.msg("内容已生成,请【点击下载】下载!", {
            time: 2000
          });
        });
    },
    batchToM2: function () {
      let num = 0;
      if (!this.ToM2Info.ids) {
        layer.msg("请勾选需转客的客户");
        return;
      }
      let array = this.ToM2Info.ids.split(",");
      this.ToM2Info.num = array.length - 1;
      $("#batchToM2Modal").modal({
        backdrop: "static",
        keyboard: false
      });
    },
    checkAll: function () {
      const checked = $("input[name='checkAll']").is(":checked");

      if (checked) {
        $("input[type=checkbox]").prop("checked", true);
      } else {
        $("input[type=checkbox]").prop("checked", false);
      }
    },
    completePhone: function (id, mobile) {
      this.mobileCompleteInfo.id = id;
      this.mobileCompleteInfo.mobile = mobile;
      this.mobileCompleteInfo.date = new Date().getMilliseconds();
      $("#mobileCompleted").modal({
        backdrop: "static",
        keyboard: false
      });
    },
    audit: function (id, title, checkSwitch, lastCheckTime, premisesId) {
      this.auditInfo.id = id;
      this.auditInfo.title = title;
      this.auditInfo.premisesId = premisesId;
      this.auditInfo.checkSwitch = checkSwitch;
      this.auditInfo.lastCheckTime = lastCheckTime;
      if ("报备审核" == title) {
        this.auditInfo.customerStatus = 10;
      } else if ("到访审核" == title) {
        this.auditInfo.customerStatus = 6;
      }
      this.$refs.audit.init();
      $("#auditModal").modal({
        backdrop: "static",
        keyboard: false
      });
    },
    changeInsert: function (id) {
      const url = this.utilHelper.apiUrl + "/api/getFirstPayment";
      const body = {
        params: {
          id
        }
      };
      this.$http.post(url, body).then((response) => {
        const data = response.body.resData;
        delete response.body.resData.result;
        this.firstPaymentInfo = response.body.resData;
        $("#insertModal").modal("show");
      });
    },
    changeConfirm: function (cusPre) {
      this.confirmInfo.id = cusPre.id;
      this.confirmInfo.confirmStatus = cusPre.confirmStatus;
      this.confirmInfo.buildingName = cusPre.buildingName;
      this.confirmInfo.roomName = cusPre.roomName;
      $("#confirmModal").modal({
        backdrop: "static",
        keyboard: false
      });
    },
    changeMortgage: function (id) {
      this.mortgageInfo.id = id;
      $("#mortgageModal").modal({
        backdrop: "static",
        keyboard: false
      });
    },
    toM2: function (id, premisesName, name, mobile) {
      this.m2Info.id = id;
      this.m2Info.premisesName = premisesName;
      this.m2Info.name = name;
      this.m2Info.mobile = mobile;
      $("#toM2Modal").modal({
        backdrop: "static",
        keyboard: false
      });
    },
    toM2: function (id, premisesName, name, mobile) {
      this.m2Info.id = id;
      this.m2Info.premisesName = premisesName;
      this.m2Info.name = name;
      this.m2Info.mobile = mobile;
      $("#toM2Modal").modal("show");
    },
    toSignFail: function (id) {
      this.signFailCusPre.id = id;
      $("#signFail").modal({
        backdrop: "static",
        keyboard: false
      });
    },
    toCopy(cusPre) {
      var _self = this;
      let visitTime = "";
      let createTime = "";
      if (cusPre.hopeVisitTime) {
        visitTime = formatDate(cusPre.hopeVisitTime, "yyyy-MM-dd hh:mm:ss");
      }
      if (cusPre.createTime) {
        createTime = formatDate(cusPre.createTime, "yyyy-MM-dd hh:mm:ss");
      }
      _self.copyContent =
        cusPre.premisesName +
        "\r\n" +
        "客户姓名：" +
        cusPre.name +
        "\r\n" +
        "客户性别：" +
        cusPre.genderName +
        "\r\n" +
        "客户号码：" +
        cusPre.mobile +
        "\r\n" +
        "中介机构门店：" +
        cusPre.staffCompanyName +
        " " +
        cusPre.staffStoreName +
        " " +
        cusPre.staffGroupName +
        "\r\n" +
        "中介经纪人：" +
        cusPre.staffName +
        "\r\n" +
        "经纪人电话：" +
        cusPre.staffPhone +
        "\r\n" +
        "预计到访时间：" +
        visitTime +
        "\r\n" +
        "报备时间：" +
        createTime +
        "\r\n";

      var url = this.utilHelper.apiUrl + "/api/getReportModelInfoList";
      var body = {};
      body.params = {
        reportId: cusPre.id,
        premisesId: cusPre.premisesId,
        mobile: cusPre.mobile,
        agencyName: cusPre.staffName,
        agencyPhone: cusPre.staffPhone,
        premisesName: cusPre.premisesName,
        customerName: cusPre.name,
        genderName: cusPre.genderName,
        storeName:
          cusPre.staffCompanyName +
          " " +
          cusPre.staffStoreName +
          " " +
          cusPre.staffGroupName,
        visitTime: visitTime,
        createTime: createTime,
        recommenderUuid: cusPre.recommenderUuid
      };
      _self.$http.post(url, body).then(
        (response) => {
          var resBody = response.body;

          if (resBody.result == "1") {
            if (resBody.resData.repotModelDetail) {
              _self.copyContent = resBody.resData.repotModelDetail;
            }
            this.copy(_self.copyContent);
          }
        },
        (response) => {
          this.copy(_self.copyContent);
        }
      );
      cusPre.copyCount += 1;
    },
    copy(copyContent) {
      console.log(88, copyContent);
      // this.$copyText(this.copyContent).then(
      //   function (e) {
      //     layer.msg("复制成功");
      //   },
      //   function (e) {
      //     layer.msg("复制失败，请手动复制");
      //   }
      // );
      const clipboard = new ClipboardJS(".ivu-btn", {
        // 点击copy按钮，直接通过text直接返回复印的内容
        text: () => copyContent // 该文本则为需要复制的内容
      });
      // 通过传递DOM选择器，HTML元素或HTML元素列表实例化
      clipboard.on("success", (e) => {
        layer.msg("复制成功");
        e.clearSelection();
        // 释放内存
        clipboard.destroy();
      });
      clipboard.on("error", (e) => {
        // 不支持复制
        layer.msg("复制失败，请手动复制");
        // 释放内存
        clipboard.destroy();
      });
    }
  }
};
</script>
<style lang="less" scoped>
.ivu-tag {
  height: auto;
}
.search-container {
  display: table;
  padding-bottom: 15px;
  .search-container-left,
  .search-container-right {
    display: table-cell;
  }
  .search-container-right {
    width: 200px;
  }
}
</style>